<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	    		xmlns:ui="http://java.sun.com/jsf/facelets"
				xmlns:c="http://java.sun.com/jsp/jstl/core"
				xmlns:h="http://java.sun.com/jsf/html"
				xmlns:p="http://primefaces.org/ui">
				
<ui:composition template="/layouts/sinMenuLayout.xhtml">


<ui:define name="title">
		<h:outputText value="#{msg.cabecera_title}" />
</ui:define>


<ui:define name="content">
<div>
	<c:if test="${not empty param.login_error}">
		<div class="ui-messages-error ui-corner-all">
			<h:outputText value="#{msg.login_errorLogin}" />
			Reason: #{sessionScope.SPRING_SECURITY_LAST_EXCEPTION.message}
		</div>
	</c:if>
	
	<form name="f" action="${request.contextPath}/spring/loginProcess" method="post">
	<h:form>
		<h:panelGroup layout="block" styleClass="bloqueCentralDatos">
			<fieldset>
				<legend><h:outputText value="&nbsp;&nbsp;#{msg.login_accesoUsuario}&nbsp;&nbsp;"/></legend>
					
					<h:panelGrid id="loginPanel" columns="2" width="100%" columnClasses="login,porcen60" >
						<h:outputText value="#{msg.login_usuario}" />
						<c:if test="${not empty param.login_error}">
							<c:set var="username" value="${sessionScope.SPRING_SECURITY_LAST_USERNAME}"/>
						</c:if>
						<input type="text" name="j_username" value="#{username}" />  
						<h:outputText value="#{msg.login_clave}"/>
						<input type="password" name="j_password" />	
					</h:panelGrid>
					
					
					<h:panelGroup layout="block" styleClass="separacionVertical"/>
						<h:panelGroup layout="block" styleClass="bloqBotonera">
							<h:panelGrid columns="1" columnClasses="botoneraCentral" cellpadding="0" width="100%" cellspacing="0" border="0">				
								<h:panelGrid columns="1" width="100%" border="0">
									<h:panelGroup styleClass="botonCentralBotonera">
											<p:commandButton id="submitButton" value="#{msg.botonera_entrar}" title="#{msg.botonera_entrar}" onclick="submit()"/> 
									</h:panelGroup>				
								</h:panelGrid>
							</h:panelGrid>
					</h:panelGroup>
			</fieldset>
			
			
			 
			
		</h:panelGroup>
	</h:form>
	</form>
</div>
</ui:define>
</ui:composition>
</html>